package com.huopaolan.yohuoshop.Adapter;

import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.huopaolan.yohuoshop.Bean.ShoppingTrolleyEntity;
import com.huopaolan.yohuoshop.NetWork.API;
import com.huopaolan.yohuoshop.R;

public class CarListAdapter extends BaseQuickAdapter<ShoppingTrolleyEntity.Values, BaseViewHolder> {
    public CarListAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, ShoppingTrolleyEntity.Values item) {
        ImageView view = helper.getView(R.id.car_shop_image);
        Glide.with(helper.itemView.getContext()).load(API.BaseUrl + item.car_path).into(view);
        helper.setText(R.id.car_shop_name, item.shop_name);
        helper.setText(R.id.car_shop_all, "颜色：" + item.shop_color + " 尺码:" + item.shop_size);
        helper.setText(R.id.car_shop_moneys, "￥ " + item.shop_price);
        helper.setText(R.id.car_shop_counts, "x " + item.shop_num);
        helper.setChecked(R.id.car_check,item.flag);
    }
}
